<#include "/common/head.ftl">

<html>

<head>

<title>Study Report</title>

<style>
	
table.nameTable {
	empty-cells:show;
	border-top: 1px solid black;
	border-right: 1px solid black;
}

table.nameTable tr {
	
}

table.nameTable tr td {
	border-left: 1px solid black;
	border-bottom: 1px solid black;
}

</style>

</head>

<body style="padding:0cm">

<div style="width:29.5cm;text-align:left;margin:0cm;padding:0px">

<h2 style="text-align:center;padding-top:0cm;margin:0cm">STUDY REPORT</h2>

<br/>

<table class="nameTable" border="0" style="solid black;width:28cm;margin-left:0cm;padding:0cm" cellspacing="0" cellpadding=0">
	<tr style="text-align:center;font-weight:bold;background-color:#C0C0C0">
		<td>No.</td>
		<td>Student</td>
		<td style="width:10px">Class</td>
		<td>Room</td>
		<td style="width:90px">Shift</td>
		<td style="width:90px">Start Date</td>
		<td style="width:90px">End Date</td>
		<td style="width:90px">Receipt</td>
		<td>Absence</td>
		<td>Result</td>
		<td>Grade</td>
		<td>Note</td>
	</tr>
	<#list students as student>
		<tr>
			<td style="text-align:center;font-weight:bold" rowspan="${map(student).size()}">${student_index + 1}</td>
			<td style="font-weight:bold" rowspan="${map(student).size()}">${student.fullName}</td>
		<#list map(student) as receipt>
				<td>${(receipt.offering.name)!}</td>
				<td style="text-align:center">${(receipt.offering.room.code)!}</td>
				<td style="text-align:center">${(receipt.offering.shift.startTime?time)!}-${(receipt.offering.shift.endTime?time)!}</td>
				<td style="text-align:center">${(receipt.offering.startDate?date)!}</td>
				<td style="text-align:center">${(receipt.offering.endDate?date)!}</td>
				<td style="text-align:center">${(receipt.number)!}</td>
				<td style="text-align:center">${(receipt.member.absentAttendances.size())!}</td>
				<td style="text-align:center">${(receipt.member.totalScore)!(receipt.member.finalTest.oldTotal)!}</td>
				<td style="text-align:center">${(receipt.member.grade)!(receipt.member.finalTest.oldGrade)!}</td>
				<td>${(receipt.member.comment)!}</td>
		</tr>
		</#list>
	</#list>
</table>

<br/>

<h2 style="text-align:center;padding-top:0cm;margin:0cm">INACTIVE STUDENT REPORT</h2>

<br/>

<table class="nameTable" border="0" style="solid black;width:28cm;margin-left:0cm;padding:0cm" cellspacing="0" cellpadding=0">
	<tr style="text-align:center;font-weight:bold;background-color:#C0C0C0">
		<td>No.</td>
		<td>Student</td>
		<td style="width:10px">Class</td>
		<td>Room</td>
		<td style="width:90px">Shift</td>
		<td style="width:90px">Start Date</td>
		<td style="width:90px">End Date</td>
		<td style="width:90px">Receipt</td>
		<td>Absence</td>
		<td>Result</td>
		<td>Grade</td>
		<td>Note</td>
	</tr>
	<#list unstudyStudents as student>
		<tr>
			<td style="text-align:center;font-weight:bold" rowspan="${unstudyMap(student).size()}">${student_index + 1}</td>
			<td style="font-weight:bold" rowspan="${unstudyMap(student).size()}">${student.fullName}</td>
		<#list unstudyMap(student) as receipt>
				<td>${(receipt.offering.name)!}</td>
				<td style="text-align:center">${(receipt.offering.room.code)!}</td>
				<td style="text-align:center">${(receipt.offering.shift.startTime?time)!}-${(receipt.offering.shift.endTime?time)!}</td>
				<td style="text-align:center">${(receipt.offering.startDate?date)!}</td>
				<td style="text-align:center">${(receipt.offering.endDate?date)!}</td>
				<td style="text-align:center">${(receipt.number)!}</td>
				<td style="text-align:center">${(receipt.member.absentAttendances.size())!}</td>
				<td style="text-align:center">${(receipt.member.totalScore)!(receipt.member.finalTest.oldTotal)!}</td>
				<td style="text-align:center">${(receipt.member.grade)!(receipt.member.finalTest.oldGrade)!}</td>
				<td>${(receipt.member.comment)!}</td>
		</tr>
		</#list>
	</#list>
</table>
	
</div>

</body>
</html>